<?php
		
	include('class.phpmailer.php');
		
	function sendMail($to,$subject,$message,$fromAddress='',$fromUserName='',$toName='',$bcc='')
	{
	

		$mail = new PHPMailer();
		$mail->IsSMTP(); // send via SMTP
		$mail->Host     = "s2smtpout.secureserver.net"; // SMTP servers
		$mail->Port     = 25;
		$mail->SMTPAuth = true;     // turn on SMTP authentication
		$mail->Username = "emotionsmirror@emotionsmirror.com";  // SMTP username
		$mail->Password = "panja2917"; // SMTP password
		/*
		$mail = new PHPMailer();
		$mail->IsSMTP(); // send via SMTP
		$mail->Host     = "mail.corjanta.com"; // SMTP servers
		$mail->Port     = 25;
		$mail->SMTPAuth = true;     // turn on SMTP authentication
		$mail->Username = "donot-reply@corjanta.com";  // SMTP username
		$mail->Password = "cor@1234"; // SMTP password*/

		
		
		$mail->ClearAddresses();
		$find = strpos($to,',');
		if($find)
		{
			$ids = explode(',',$to);
			for($i=0;$i<count($ids);$i++)
			{
				$mail->AddAddress($ids[$i]);
			}
		}
		else
		{
			$mail->AddAddress($to);
		}
		

		if($fromAddress!=''){
			$mail->From     = $fromAddress;
		} else {
			$mail->From     = "donot-reply@emotionsmirror.com";
		}
		if($fromUserName!=''){
			$mail->FromName = $fromUserName;
		} else {
			$mail->FromName = "emirror support";	
		}
		
		$mail->WordWrap = 50; 
		$mail->IsHTML(true);
		
		$mail->Subject = $subject;			
		$mail->Body = $message;
		
		if($mail->Send())
		{
			return 1;	
		}
		else
		{
			return 0;	
		}
	}
